<?php
/**
 * CompleXml Framework
 *
 * @category   CompleXml
 * @package    CompleXml_Dataset
 * @copyright  Copyright (c) 2008 Andrey Kucherenko
 * @license    New BSD License
 * @version    $Id: Session.php 8 2008-11-13 14:50:42Z kucherenko.andrey $
 */

require_once 'CompleXml/Dataset/Abstract.php';
class CompleXml_Dataset_Session extends CompleXml_Dataset_Abstract
{
    public function __construct ()
    {
        @session_start();
        parent::__construct($_SESSION);
    }
    public function setValue ($name, $val)
    {
        $_SESSION[ $name ] = $val;
        parent::setValue($name, $val);
    }
    public function destroy ()
    {
        session_destroy();
    }
    public function unregister ($name)
    {
        if (session_is_registered($name)) {
            parent::__unset($name);
            session_unregister($name);
            unset($_SESSION[ $name ]);
        }
    }
}
